/* å“åº”å¼å¸ƒå±€åŸºç¡€è®¾ç½® */
:root {
    --hud-height: 60px;
    --ability-size: 80px;
    --menu-padding: 40px;
    --border-radius: 20px;
}

/* ç§»åŠ¨è®¾å¤‡æ–­ç‚¹ */
@media (max-width: 768px) {
    :root {
        --hud-height: 50px;
        --ability-size: 60px;
        --menu-padding: 20px;
        --border-radius: 15px;
    }

    h1 {
        font-size: 2.5rem !important;
        margin-bottom: 2rem !important;
    }

    .menu-options {
        min-width: 250px !important;
    }

    button {
        padding: 1rem 1.5rem !important;
        font-size: 1.1rem !important;
    }

    .tutorial-content {
        padding: 1rem !important;
        max-height: 60vh !important;
    }

    .setting-item {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .setting-item label {
        margin-bottom: 0.5rem !important;
    }


    .abilities {
        bottom: 80px !important;
    }
}

/* å…¨å±€æ ·å¼ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* æ˜Ÿç©ºèƒŒæ™¯å¢žå¼º */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a2463 0%, #001233 50%, #000000 100%);
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle var(--duration) infinite;
    box-shadow: 0 0 4px #fff, 0 0 8px #fff;
}

.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.8) 50%, 
        rgba(0,255,255,0.4) 100%);
    animation: shoot var(--duration) linear infinite;
    transform: rotate(var(--angle));
    box-shadow: 0 0 20px #0ff;
}

.nebula {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, 
        rgba(var(--color-1), 0.3) 0%,
        rgba(var(--color-2), 0.2) 50%,
        rgba(0,0,0,0) 100%);
    animation: pulse 8s infinite alternate;
    filter: blur(30px);
    mix-blend-mode: screen;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

@keyframes shoot {
    0% { transform: translateX(-100%) rotate(var(--angle)); }
    100% { transform: translateX(100vw) rotate(var(--angle)); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 0.8; }
}

/* æ¸¸æˆå®¹å™¨æ ·å¼ */
.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: transparent;
    overflow: hidden;
}

/* æ¸¸æˆç”»å¸ƒæ ·å¼ */
#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: transparent;
}

/* ä¸»èœå•å’Œå…¶ä»–èœå•çš„åŸºç¡€æ ·å¼ */
.menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.menu.hidden {
    display: none;
}

/* èœå•æ ‡é¢˜æ ·å¼ */
h1 {
    font-size: 4.5rem;
    background: linear-gradient(45deg, #00ff88, #00b8ff, #00ff88);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
    margin-bottom: 3rem;
    letter-spacing: 4px;
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.2); }
}

/* èœå•é€‰é¡¹å®¹å™¨ */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    min-width: 300px;
}

/* æŒ‰é’®æ ·å¼ä¼˜åŒ– */
button {
    width: 100%;
    padding: 1.2rem 2.5rem;
    font-size: 1.3rem;
    background: linear-gradient(45deg, #00ff88, #00b8ff);
    border: none;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

button:active {
    transform: translateY(0) scale(0.95);
}

/* æ•™ç¨‹èœå•æ ·å¼ä¼˜åŒ– */
.tutorial-content {
    background: rgba(0, 20, 40, 0.9);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.2);
    margin: 2rem 0;
}

/* æ•™ç¨‹å†…å®¹æ»šåŠ¨æ¡æ ·å¼ */
.tutorial-content::-webkit-scrollbar {
    width: 8px;
}

.tutorial-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.tutorial-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #00ff88, #00b8ff);
    border-radius: 4px;
}

/* æ•™ç¨‹éƒ¨åˆ†æ ·å¼ */
.tutorial-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(0, 255, 136, 0.1);
}

.tutorial-section h3 {
    color: #00ff88;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.tutorial-section p {
    color: #fff;
    margin: 0.8rem 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* è®¾ç½®èœå•æ ·å¼ä¼˜åŒ– */
.settings-content {
    width: 90%;
    max-width: 600px;
    background: rgba(0, 20, 40, 0.9);
    border-radius: var(--border-radius);
    padding: var(--menu-padding);
}

.setting-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* è¿”å›žæŒ‰é’®ç‰¹æ®Šæ ·å¼ */
button#back-to-main,
button#back-to-main-2,
button#back-to-main-3 {
    background: linear-gradient(45deg, #ff4444, #ff8800);
    margin-top: 2rem;
}

/* æ¸¸æˆç»“æŸèœå•æ ·å¼ */
#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#game-over.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

#game-over h2 {
    font-size: 4rem;
    margin-bottom: 30px;
    color: #ff4444;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* åŠ¨ç”»æ•ˆæžœ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu {
    animation: fadeIn 0.5s ease-out;
}

/* å“åº”å¼è®¾è®¡ */
@media (max-width: 1200px) {
    .game-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}

/* å‡çº§æ¶ˆæ¯æ ·å¼ */
.level-up-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 255, 136, 0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    animation: fadeInOut 3s ease-in-out;
    z-index: 1000;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    20% { transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* èµ„æºå›¾æ ‡æ ·å¼ */
.resource-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    vertical-align: middle;
}

/* å‡çº§æŒ‰é’®æ ·å¼ */
.upgrade-button {
    background: linear-gradient(45deg, #00b8ff, #00ff88);
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-button:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.upgrade-button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* èµ„æºæ”¶é›†åŠ¨ç”» */
@keyframes collect {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

.resource-collect {
    animation: collect 0.5s ease-out forwards;
}

/* æŒ‰é’®ç»„æ ·å¼ */
.button-group {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

/* å‘å…‰æŒ‰é’®æ ·å¼ */
.glow-button {
    background: linear-gradient(45deg, #00ff88, #00b8ff);
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.glow-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.5);
}

.glow-button:active {
    transform: translateY(0) scale(0.95);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

/* æ¸¸æˆç•Œé¢æ ·å¼ */
#game-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#game-screen.hidden {
    display: none;
}

/* ä¸»èœå•æ ·å¼ */
#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    background: rgba(0, 0, 0, 0.9);
}

#main-menu.hidden {
    display: none;
}

/* å“åº”å¼è°ƒæ•´ */
@media (max-height: 800px) {
    h1 {
        font-size: 3.5rem;
        margin-bottom: 2rem;
    }
    
    .tutorial-content {
        max-height: 60vh;
    }
    
    button {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}












/* æŠ€èƒ½æŒ‰é’®æ ·å¼ */
.abilities {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.ability-button {
    width: var(--ability-size);
    height: var(--ability-size);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 136, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ability-button:hover {
    background: rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.5);
}

.ability-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

/* è®¾ç½®èœå•æ ·å¼ */
.settings-content {
    width: 90%;
    max-width: 600px;
    background: rgba(0, 20, 40, 0.9);
    border-radius: var(--border-radius);
    padding: var(--menu-padding);
}

.setting-item {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-item label {
    min-width: 100px;
    color: #fff;
}

.setting-item input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(0, 255, 136, 0.2);
    border-radius: 4px;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
}

.setting-item select {
    flex: 1;
    padding: 8px;
    background: rgba(0, 255, 136, 0.2);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}

/* è­¦å‘ŠæŒ‰é’®æ ·å¼ */
.warning {
    background: linear-gradient(45deg, #ff4444, #ff8800) !important;
}

/* å…¨å±æ¨¡å¼ */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
}

/* ç§»åŠ¨ç«¯è§¦æŽ§æŒ‰é’® */
@media (max-width: 768px) {
    .touch-controls {
        position: absolute;
        bottom: 20px;
        left: 20px;
        display: flex;
        gap: 10px;
    }

    .touch-button {
        width: 50px;
        height: 50px;
        background: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: #fff;
    }
}

/* åŠ¨ç”»æ•ˆæžœ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu {
    animation: fadeIn 0.3s ease-out;
}

/* æš‚åœèœå•æ ·å¼ */
#pause-menu {
    background: rgba(0, 0, 0, 0.9);
}

/* ç¡®ä¿èœå•é€‰é¡¹åž‚ç›´æŽ’åˆ— */
.menu-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

/* æŒ‰é’®ç»„æ ·å¼ */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }
}

/* æŠ€èƒ½å›¾æ ‡å®¹å™¨æ ·å¼ */
.abilities-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

/* æŠ€èƒ½å›¾æ ‡ */
.ability-icon {
    position: relative;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ability-icon:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 136, 0.8);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.ability-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* æŠ€èƒ½å›¾æ ‡ç¬¦å· */
.ability-symbol {
    font-size: 24px;
    font-style: normal;
}

/* æŠ€èƒ½æŒ‰é”®æç¤º */
.ability-key {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: rgba(0, 255, 136, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* å†·å´é®ç½© */
.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 0, 0, 0.7);
    transition: height 0.1s linear;
}

/* æŠ€èƒ½æç¤ºæ¡† */
.ability-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 5px;
}

.ability-icon:hover .ability-tooltip {
    opacity: 1;
    visibility: visible;
}

/* æŠ€èƒ½æ¿€æ´»çŠ¶æ€ */
.ability-icon.active {
    border-color: rgba(0, 255, 136, 1);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

/* æŠ€èƒ½å†·å´ä¸­çŠ¶æ€ */
.ability-icon.cooldown {
    border-color: rgba(255, 255, 255, 0.3);
    filter: grayscale(0.7);
}

/* èƒ½é‡ä¸è¶³çŠ¶æ€ */
.ability-icon.no-energy {
    border-color: rgba(255, 0, 0, 0.3);
    filter: grayscale(0.7);
}

/* å“åº”å¼è°ƒæ•´ */
@media (max-width: 768px) {
    .abilities-container {
        bottom: 10px;
        right: 10px;
    }

    .ability-icon {
        width: 50px;
        height: 50px;
    }

    .ability-symbol {
        font-size: 20px;
    }

    .ability-key {
        font-size: 10px;
    }
} 